CreateReportOnRuntimeDS
Creates a tab-separated text file, known as a field definition file, which represents the structure of the data in a specified Recordset or Rowset object. Then, the function creates a blank report file based on this field definition file. When designing an application that prints, previews, or exports the report, the field definition file can be replaced by the Recordset or Rowset in the active data source.
C Syntax
BOOL FAR PASCAL CreateReportOnRuntimeDS(LPUNKNOWN FAR *lpUnk,
LPCSTR reportFile,
LPCSTR fieldDefFile,
BOOL bOverWriteFile,
BOOL bLaunchDesigner);
Visual Basic Syntax
Declare Function CreateReportOnRuntimeDS Lib "p2smon.dll" ( _
lpUnk As Object, ByVal reportFile As String, ByVal fieldDefFile _
As String, ByVal bOverWriteFile As Long, ByVal bLaunchDesigner _
As Long) As Long
Parameters
Parameter
| Description
|
lpUnk
| The active data source used to create the field definition file. In C or C++, this is a pointer to an Unknown derived COM interface relating to a DAO or ADO Recordset. In Visual Basic, this is a Recordset or Rowset object.
|
reportFile
| The path and file name of the report file to be created.
|
fieldDefFile
| The path and file name of the field definition file to be created.
|
bOverWriteFile
| If a field definition file already exists with the specified path and file name, this flag indicates whether or not to overwrite that file.
|
bLaunchDesigner
| If True (1), Crystal Reports is launched with the newly created report file opened. Crystal Reports must be installed on the system.
|
Return Value
Returns 0 (False) if the call failed. Returns 1 (True) if the call succeeded and the field definition file was created.
Remarks
This function creates a field definition file, then creates a report file based on that field definition file. The function CreateFieldDefFile, is unnecessary when this function is used.